<?php
/**
 * Created by PhpStorm.
 * User: PEMEO
 * Date: 10/5/2014
 * Time: 9:35 PM
 */
namespace Frontend\Modules\Video\Forms;

use Phalcon\Forms\Form;
use Phalcon\Forms\Element\Text;
use Phalcon\Forms\Element\Hidden;
use Phalcon\Forms\Element\Submit;
use Phalcon\Forms\Element\Select;
use Phalcon\Validation\Validator\PresenceOf;
use Phalcon\Validation\Validator\Email;
use Phalcon\Validation\Validator\Identical;
use Phalcon\Validation\Validator\StringLength;
use Phalcon\Validation\Validator\Confirmation;
use Phalcon\Validation\Validator\Between;
use Common\Models\Videos\National;
use Common\Models\Videos\Artist;
use Common\Library\Common as LibraryCommon;

class FormCreateFilterCategory extends Form{

    public function initialize($entries = null, $option = null){

        $national = new Select('national_id' , National::find() , array('using' => array('id' , 'name') ,'ng-model' => 'SelectBoxCountries','ng-init' =>"SelectBoxCountries='$entries->national_id'" ,'useEmpty' => true , 'emptyText' => 'Quốc gia' , 'emptyValue' => 0 ,  'class' => 'forms-control col-xs-12') );
        $this->add($national);

        $artist = new Select('artist_id' , Artist::find() , array('using' => array('id' , 'name') ,'ng-model' => 'SelectBoxArtists','ng-init' =>"SelectBoxArtists='$entries->artist_id'", 'useEmpty' => true , 'emptyText' => 'Diễn viên' , 'emptyValue' => 0 ,  'class' => 'forms-control col-xs-12') );
        $this->add($artist);

        $yearPublish = new Select('year_publish' , LibraryCommon::listYear()  , array( 'ng-model' => 'SelectBoxYears','ng-init' =>"SelectBoxYears='$entries->year'",'useEmpty' => true , 'emptyText' => 'Năm' , 'emptyValue' => 0 ,  'class' => 'forms-control col-xs-12') );
        $this->add($yearPublish);
        $this->add(new Submit('Lọc', array(
            'class'     => 'btn btn-primary tb_search ',
            'ng-click'  => 'actionSearch()'
        )));
    }

}
